using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;

namespace Homework8.Models
{
    public class Class
    {
        public int ClassId { get; set; }
        
        [Required(ErrorMessage = "班级名称不能为空")]
        public string Name { get; set; } = string.Empty;
        
        public int? Grade { get; set; }
        
        public int SchoolId { get; set; }
        
        public string? ClassTeacher { get; set; }
        
        // 导航属性
        public School? School { get; set; }
        public List<Student> Students { get; set; } = new List<Student>();
    }
} 